package com.example.analysis.controller;

import com.example.analysis.dto.ClusterScoreDto;
import com.example.analysis.service.EvaluateSupervisionService;
import com.example.analysis.service.StudentService;
import com.example.analysis.service.SupervisionService;
import com.example.analysis.utils.Response;
import com.example.analysis.vo.ClusterScoreVo;
import com.example.analysis.vo.TimeScoreVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/time_score")
@CrossOrigin
public class TimeScoreController {
    private static final Logger log = LoggerFactory.getLogger(TimeScoreController.class);
    @Autowired
    private StudentService studentService;
    @Autowired
    private EvaluateSupervisionService evaluateSupervisionService;

    // 学生评教时间序列分析
    @PostMapping("/time")
    Response<List<TimeScoreVo>> getTimeScoreSet(@RequestParam String classId, @RequestParam String subId) {
        System.out.println(classId);
        System.out.println(subId);
        System.out.println(studentService.getTimeScoreSet(classId, subId));
        return studentService.getTimeScoreSet(classId, subId);
    }

    // 督导评教时间序列分析
    @PostMapping("/time_sup")
    Response<List<TimeScoreVo>> getTimeScoreSetSup(@RequestParam String teacherId, @RequestParam String subId) {
        System.out.println(teacherId);
        System.out.println(subId);
        return evaluateSupervisionService.getTimeScoreSet(teacherId, subId);
    }

//    @GetMapping("/cluster")
//    Response<List<ClusterScoreVo>> getCluster() {
//        return studentService.getScoreSet();
//    }
}
